package myjava.algorithm.leetcode;

class GenericMemoryCell<AnyType>
{
	public AnyType read()
	{
		System.out.println("GenericMemoryCell.read");
		return storedValue;
	}
	
	public void write(AnyType x)
	{
		System.out.println("GenericMemoryCell.write");
		storedValue = x;
	}
	
	private AnyType storedValue;
}

interface Comparable<AnyType>
{
	public int compareTo(AnyType other);
}

public class Link {
	public static void main(String[] args)
	{
		System.out.println("Link.main");
		GenericMemoryCell<Integer> m = new GenericMemoryCell<Integer>();
		m.write(7);
		int val=m.read();
		System.out.println("Contents are: "+val);
	}
}
